//#pragma comment(linker,"/STACK:16777216") /*16Mb*/
//#pragma comment(linker,"/STACK:33554432") /*32Mb*/
#define _CRT_SECURE_NO_DEPRECATE
#include<iostream>
#include<numeric>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<memory>
#include<string>
#include<vector>
#include<cctype>
#include<list>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<algorithm>
using namespace std;

typedef unsigned long long      ui64;
typedef long long               i64;
typedef	vector<int>             VI;
typedef	vector<bool>            VB;
typedef	vector<VI>              VVI;
typedef	vector<string>          VS;
typedef	pair<int,int>           PII;
typedef	pair<PII,int>           PIII;
typedef map<string,int>         MSI;
typedef set<int>                SI;
typedef set<string>             SS;
typedef map<int,int>            MII;
typedef	pair<double,double>     PDD;

#define PB                      push_back
#define MP                      make_pair
#define X                       first.first
#define Y                       first.second
#define Z                       second
#define FOR(i, a, b)            for(int i = (a); i < (b); ++i)
#define RFOR(i, a, b)           for(int i = (a) - 1; i >= (b); --i)
#define CLEAR(a, b)             memset(a, b, sizeof(a))
#define SZ(a)                   int((a).size())
#define ALL(a)                  (a).begin(), (a).end()
#define RALL(a)                 (a).rbegin(), (a).rend()
#define INF                     (2000000000)

char buf[100010];
int main()
{
	int x,y,z;
	cin >> x >> y >> z;
	string s;
	getline(cin,s);
	getline(cin,s);
	int sX,sY,sZ;
	sX = sY = sZ = 1;
	PIII a;
	FOR(i,0,SZ(s)) {
		if( s[i]=='u' )
			sY = min(sY+1,y);
		if( s[i]=='d' )
			sY = max(sY-1,1);
		if( s[i]=='r' )
			sX = min(sX+1,x);
		if( s[i]=='l' )
			sX = max(sX-1,1);
		if( s[i]=='f' )
			sZ = min(sZ+1,y);
		if( s[i]=='b' )
			sZ = max(sZ-1,1);
	}
	a = MP(MP(sX,sY),sZ);
	sX = x;
	sY = y;
	sZ = z;
	FOR(i,0,SZ(s)) {
		if( s[i]=='u' )
			sY = min(sY+1,y);
		if( s[i]=='d' )
			sY = max(sY-1,1);
		if( s[i]=='r' )
			sX = min(sX+1,x);
		if( s[i]=='l' )
			sX = max(sX-1,1);
		if( s[i]=='f' )
			sZ = min(sZ+1,z);
		if( s[i]=='b' )
			sZ = max(sZ-1,1);
	}
	i64 resX = abs(a.X - sX)+1;
	i64 resY = abs(a.Y - sY)+1;
	i64 resZ = abs(a.Z - sZ)+1;
	i64 res = resX * resY * resZ;
	cout << res << endl;
    return 0;
}